from langchain_community.embeddings import DashScopeEmbeddings, OpenAIEmbeddings
from langchain_community.vectorstores.redis import Redis, RedisText

import os
os.environ["OPENAI_API_KEY"] = "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"
os.environ["DASHSCOPE_API_KEY"] = "sk-3a2246e7cb7540878599202ad0cfc324"

rds = Redis.from_existing_index(DashScopeEmbeddings(), redis_url="redis://10.168.50.2:6378", index_name='langchain-tyqw',
                                schema=[])
is_engineer = RedisText("source") % "htty"

results = rds.similarity_search("1", filter=is_engineer)

print(results)